home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Cafe 3
/
Visual Cafe 3.ISO
/
Vcafe
/
Main.bin
/
JBorderlessButton.java
< prev
next >
Wrap
Text File
|
1998-09-02
|
2KB
|
95 lines
package com.symantec.itools.swing;
import java.awt.*;
import java.awt.event.*;
import com.sun.java.swing.*;
import com.sun.java.swing.border.*;
public class JBorderlessButton
extends JButton
implements MouseListener
{
public JBorderlessButton()
{
super();
setBorderPainted(false);
addMouseListener(this);
}
public JBorderlessButton(Icon icon)
{
super(icon);
setBorderPainted(false);
addMouseListener(this);
}
public JBorderlessButton(String text)
{
super(text);
setBorderPainted(false);
addMouseListener(this);
}
public JBorderlessButton(String text, Icon icon)
{
super(text, icon);
setBorderPainted(false);
addMouseListener(this);
}
public void setEnabled(boolean enabled)
{
super.setEnabled(enabled);
if (!enabled)
{
if (isBorderPainted())
{
setBorderPainted(false);
repaint();
}
}
}
//???RKM??? Should this be a property - this is a component that other people can use
public boolean isFocusTraversable()
{
return false;
}
//???RKM??? Why did you do this???
public boolean hasFocus()
{
return false;
}
public void mouseEntered(MouseEvent event)
{
if (!isBorderPainted() && isEnabled())
{
setBorderPainted(true);
repaint();
}
}
public void mouseExited(MouseEvent event)
{
if (isBorderPainted())
{
setBorderPainted(false);
repaint();
}
}
public void mouseClicked(java.awt.event.MouseEvent event)
{
}
public void mousePressed(java.awt.event.MouseEvent event)
{
}
public void mouseReleased(java.awt.event.MouseEvent event)
{
}
}